The Border Gateway Protocol (Border Gateway Protocol, BGP) is a dynamic routing protocol used between autonomous systems (Autonomous System, AS). Three early released versions are BGP-1 (RFC 1105), BGP-2 (RFC 1163), and BGP-3 (RFC 1267), and are mainly used for exchanging reachability routing information between ASs, constructing a propagation path between AS fields, preventing occurrence of a route loop, and applying some routing policies at an AS level. A currently used version is BGP-4 (RFC 4271). As an actual Internet (Internet) external routing protocol standard, the BGP is widely used between Internet service providers (Internet Service Provider, ISP).
A BGP Flow Specification (Flow Specification, Flow Spec) (RFC 5575) means that a traffic policy is transferred to a BGP Flow Specification peer (peer devices for transferring a BGP Flow Specification route are peers of each other) by transferring a BGP Flow Specification route, and after receiving the BGP Flow Specification route, the BGP Flow Specification peer converts preferable routing corresponding to the BGP Flow Specification route into a traffic control policy of a forwarding plane, to perform traffic control. The BGP Flow Specification route is a BGP route defined in the RFC 5575. Such a BGP Flow Specification route includes a type of BGP network layer reachability information (BGP Flow Spec NLRI) and an extended community attribute. By using the network layer reachability information and the extended community attribute, the BGP Flow Specification route may carry a traffic matching condition and an action performed after traffic matching. The RFC 5575 defines 12 types of commonly used traffic matching rules: a destination address, a source address, an IP protocol number, a port number, a destination port number, a source port number, an ICMP type, an ICMP code, a TCP flag bit, a DSCP, a fragment type, and the like. The 12 types of traffic matching rules are encapsulated in the BGP Flow Specification route, and are used as the network layer reachability information for transfer. The RFC 5575 defines four types of commonly used traffic processing behaviors: traffic discarding, rate limiting, modification to a DSCP value of a packet, and a redirect action (redirect Action). The four types of traffic processing behaviors are encapsulated in the BGP Flow Spec route, and are carried as extended community attributes. The redirect action means guiding a particular data flow to enter a corresponding forwarding channel.
Currently, there are the following six types of redirect actions (redirect Actions) supported by the BGP Flow Spec protocol: redirection to a virtual private network VPN routing and forwarding (VPN routing and forwarding, VRF) table with a route target identifier in an AS-2byte format (redirect AS-2byte), redirection to VRF table with a route target identifier in an IPv4 address format (redirect IPv4 format), redirection to VRF table with a route target identifier in an AS-4byte format (redirect AS-4byte), redirection to VRF table with a route target identifier in an IPv6 address format (redirect IPv6 specific AS), redirection to an IPv4 next hop (redirect IPv4 address), and redirection to an IPv6 next hop (redirect IPv6 address).
When a related application is extended in a conventional manner, for example, redirection to VRF/an IP/a tunnel (Tunnel), the BGP Flow Spec protocol needs to be patched each time a new service requirement is added. Consequently, the BGP Flow Spec protocol is always changing. For example, in a currently studied BGP Flow Spec Redirect Actions solution, a general path-ID is defined, to guide a data flow to enter a transport layer tunnel corresponding to the path-ID. Therefore, the path-ID needs to be added to an extended community attribute in the BGP Flow Spec protocol, and if necessary, specific information of the tunnel further needs to be carried.
Therefore, if a related application is still extended in the conventional manner, unlimited extension of the BGP Flow Spec protocol is caused.